package com.googlecode.c4e.ui.actions.internal;

import java.lang.reflect.InvocationTargetException;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.operation.IRunnableWithProgress;

import com.googlecode.c4e.api.Registry;
import com.googlecode.c4e.api.model.BuildResult;
import com.googlecode.c4e.api.model.Project;

public class BuildLogRunnable implements IRunnableWithProgress {

	private Project project;
	private BuildResult buildResult;

	public BuildLogRunnable(Project project) {
		this.project = project;
	}

	public void run(IProgressMonitor monitor) throws InvocationTargetException,
			InterruptedException {
		try {
			buildResult = Registry.getDefault().lastBuildResult(project);
		} catch (Exception e) {
			throw new InvocationTargetException(e);
		}
	}

	public BuildResult getResult() {
		return buildResult;
	}
}
